<%-- 
    Document   : addmovies
    Created on : Jul 23, 2012, 1:25:42 AM
    Author     : Atienza-Home
--%>


<%@page import="java.util.Iterator"%>
<%@page import="Factory.Tables.Category"%>
<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%
   
    
    ArrayList<Category> result = (ArrayList<Category>)session.getAttribute("categories");
    Iterator<Category> iter;
    Category category;
    
%>


<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Add Movie | Moviestore.com</title>
        
        <link href="../adminpanel/header.css" rel="stylesheet" type="text/css"></link>
        <script type="text/javascript" src="ajaxmain_admin.js"></script>
        <script type="text/javascript" src="jquery.js"></script>
        
    </head>
    <body>
        
        <form name="MovieAddForm" action="javascript:movieAdd();" method="GET">
        <div id="header"><font color="#006666" style=" font-size: 30px; font-weight: bold;">Add Movie | Moviestore.com</font></div>
        
        <div id="realbody">
            
            
                <div id="addmovieerror"></div>
            
                <div id="moviename" style=" padding: 10px; background-color: #006666">
                    <font color="white">Name: </font><input id="inputmoviename"/>
                        
                    
                </div>
            
                <div id="moviepic" style=" padding: 10px; background-color: #009999">
                    <font color="white">Picture:</font><br>
                       
                    <input id="inputmoviepic"  type="file" onchange="javascript:changepic();">
            
                </div>
                
                <div id="moviecategory" style=" padding: 10px; background-color: #006666">
                    <font color="white">Category:</font>
                    <select id="moviecategoryselect">
                    <%
                    int i;
                    if(result!=null){
                        iter = result.iterator(); 
                        i=0;
                        while(iter.hasNext()){
                            category = iter.next();
            
                           
                            %>
                                <option value="<%=category.getCategoryID()%>"><%=category.getCategoryName()%></option>    
                            <%
                        }
            
                            i++;               
                    }
                    
    

                    %>  
                    </select>
                    
                </div>    
                    
                
                <div id="moviereleasedate" style=" padding: 10px; background-color: #009999">
                    <font color="white">Release Date(YYYY-MM-DD):</font><br>
                    <input id="inputmoviereleasedate" type="text">
      
            
                </div>
        
                <div id="movieprice" style=" padding: 10px; background-color: #009999">
                    <font color="white">Price:</font><br>
                    <input id="inputmovieprice" min="0" type="number">
      
            
                </div>
                    
                
                <div id="moviedescription" style=" padding: 10px; background-color: #006666;"> 
                    <font color="white">Description:</font><br>
                    <textarea cols='115' rows='15' id='inputmoviedesc'></textarea>
                </div>
            
                <div id="submitaddmovie" style="padding: 0px;">
                    <input type="submit" value="Add" style="padding:5px; width: 990px; " />            
                </div>
                
        </div>
                
        </form>
        
        
        
        
    </body>
</html>
